package Text_68;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.stream.Stream;

public class Code {

	public static void main(String[] args) {
		 //stream流
        //单列集合
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"1","2","3","4","5","6","7","8");
        list.stream().forEach(s -> System.out.print(s+" "));
        System.out.println();
        System.out.println("=================");
        //双列集合
        HashMap<String,String> hm = new HashMap();
        hm.put("郭靖","黄蓉");
        hm.put("杨过","小龙女");
        hm.put("张三","张蓉");
        hm.put("李四","李依");

        hm.keySet().stream().forEach(s -> System.out.print(s+" "));
        System.out.println();
        hm.entrySet().stream().forEach(s -> System.out.print(s+" "));
        System.out.println("=================");
        //数组
        int[] arr1 = {1,2,3,4,5,6,7,8};
        Arrays.stream(arr1).forEach(s -> System.out.print(s+" "));
        //基本数据类型->整体
        Stream.of(arr1).forEach(s -> System.out.print(s+" "));
        //引用数据类型->数据
        Stream.of(list).forEach(s -> System.out.print(s+" "));


	}

}
